package com.lyq.controller;

import com.lyq.mapper.HospitalMapper;
import com.lyq.pojo.Hospital;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lyq
 * @since 2020-05-08
 */
@RestController
@RequestMapping("/weixing/hospital")
public class HospitalController {
    @Autowired
    private HospitalMapper hospitalMapper;

    /**
     *小程序端无条件获取医院列表信息
     * @return
     */
    @RequestMapping("/selectHospital")
    public List<Hospital> selectHospital(){
        List<Hospital> hospitalList = hospitalMapper.selectList(null);
        return hospitalList;
    }

    /**
     * 根据id获得医院信息
     * @param id
     * @return
     */
    @RequestMapping("/selecthospitalrById")
    public Hospital selectHospitalById(Integer id){
        Hospital hospital = hospitalMapper.selectById(id);
        return hospital;
    }

}

